1.1 Viz Top 5K Gene Dataset

In [1]:
import gene_exp_10x
In [2]:
df_ini = gene_exp_10x.load_gene_exp_to_df('../download/atlas/atlas_data_5k-sum/')
df_ini.shape
Out[2]:
(5000, 139331)
In [3]:
gene_sum = df_ini.sum(axis=1)
gene_sum.shape
Out[3]:
(5000,)
In [4]:
from clustergrammer2 import net
clustergrammer2 backend version 0.2.9
In [ ]:
 
In [5]:
def umi_norm(df):
    # umi norm
    barcode_umi_sum = df.sum()
    df_umi = df.div(barcode_umi_sum)
    return df_umi
In [6]:
df_small = umi_norm(df_ini.iloc[:,:5000])
df_small.shape
Out[6]:
(5000, 5000)
In [7]:
net.load_df(df_small)
net.filter_N_top(inst_rc='row', N_top=500, rank_type='var')
net.normalize(axis='row', norm_type='zscore')
net.clip(-5,5)
net.load_df(net.export_df().round(2))
net.widget()
In [ ]: